home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / cuj1008.zip / 1008074A < prev    next >
Text File  |  1991-10-14  |  2KB  |  60 lines

  1. /*
  2. Copyright (c) Robert Ramey 1991. All Rights Reserved
  3. */
  4.  
  5. #include <stdio.h>
  6. #include <signal.h>
  7. #include "psort.h"
  8. #include "os.h"
  9. /*********************************************************************
  10. os_init - initialize input/output
  11. **********************************************************************/
  12. os_init(argc, argv)
  13. int argc;
  14. char *argv[];
  15. {
  16.     if(signal(SIGINT, SIG_DFL) == SIG_ERR)
  17.         error("Couldn't establish ^C handler");
  18. }
  19. /*********************************************************************
  20. error - takes control when aborted with ^C
  21. **********************************************************************/
  22. void
  23. error(msg)
  24. char *msg;
  25. {
  26.     fputs(msg, stderr);
  27.     exit(1);
  28. }
  29. /*********************************************************************
  30. cbreak - takes control when aborted with ^C
  31. **********************************************************************/
  32. /*
  33. void
  34. cbreak()
  35. {
  36.     fputs("Aborted by Operator", stderr);
  37.     exit(3);
  38. }
  39. */
  40. /*********************************************************************
  41. os_mavl - figure how much memory can be allocated
  42. **********************************************************************/
  43. /*
  44. MEM_SIZE
  45. os_mavl()
  46. {
  47.     return (MEM_SIZE)_bios_memsize() / K;
  48. }
  49. */
  50. /*********************************************************************
  51. os_flength - returns number of bytes in file
  52. **********************************************************************/
  53. #include <io.h>
  54. FILE_SIZE
  55. os_flength(fptr)
  56. FILE *fptr;
  57. {
  58.     return filelength(fileno(fptr));
  59. }
  60.